package com.example.administrator.myapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

public class DetailActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail);
        //获取传递过来的意图
        Intent intent = getIntent();
        //从意图中获取数据
        int position = intent.getIntExtra("position", 0);

        String title = intent.getStringExtra("title");
        String comment = intent.getStringExtra("comment");
        String content = intent.getStringExtra("content");
        String type = intent.getStringExtra("type");
        String icon = intent.getStringExtra("icon");

        Toast.makeText(this,""+title+position+comment+content+type+icon,Toast.LENGTH_SHORT).show();

    }
}
